#!/bin/sh

source /etc/certificate-service.conf


is_jboss_running(){
    checkjboss=`/bin/ps -ef | grep '${JBOSS_HOME}/bin/run.sh' | grep -v grep`
    if [ "x${checkjboss}" != "x" ] ; then
        return 0
    else
        return 1
    fi
    
}

is_jboss_running
if [ $? -eq 0 ] ; then
	echo "jboss is running please stop it first"
	exit
fi

mkdir /var/log/jboss

chown -R jboss.jboss /var/log/jboss

mv ${JBOSS_HOME}/server/default/log/* /var/log/jboss/
rmdir ${JBOSS_HOME}/server/default/log/
ln -s /var/log/jboss/ ${JBOSS_HOME}/server/default/log/
